package com.insigma.yanwenlong.bookkeeping.service;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;

import com.insigma.yanwenlong.bookkeeping.dao.DetailDao;
import com.insigma.yanwenlong.bookkeeping.dao.DetailDaoImpl;
import com.insigma.yanwenlong.bookkeeping.pojo.DayConsumeCondition;
import com.insigma.yanwenlong.bookkeeping.pojo.Detail;
import com.insigma.yanwenlong.bookkeeping.pojo.DetailCondition;
import com.insigma.yanwenlong.bookkeeping.pojo.YearConsumeCondition;
import com.insigma.yanwenlong.bookkeeping.pojo.vo.DetailVo;

public class DetailServiceImpl implements DetailService{
	private DetailDao detailDao = new DetailDaoImpl();

	@Override
	public List<DetailVo> findDetails() throws SQLException {
		return detailDao.findDetails();
	}

	@Override
	public List<DetailVo> findDetailsBy(String accountName, Date startTime,
			Date stopTime, String categoryName, String note)
			throws SQLException {
		return detailDao.findDetailsBy(accountName, startTime, stopTime, categoryName, note);
	}

	@Override
	public DetailVo finDetailVoById(int id) throws SQLException {
		return detailDao.finDetailVoById(id);
	}

	@Override
	public int updateDetailByDetailVo(DetailVo detailVo) throws SQLException {
		return detailDao.updateDetailByDetailVo(detailVo);
	}

	@Override
	public int deleteDetailById(int id) throws SQLException {
		return detailDao.deleteDetailById(id);
	}

	@Override
	public int addDetail(Detail detail) throws SQLException {
		return detailDao.addDetail(detail);
	}

	@Override
	public List<DetailVo> findDetailsBy(String accountName, Date startTime,
			Date stopTime, String memberName, double beginMoney, double endMoney)
			throws SQLException {
		return detailDao.findDetailsBy(accountName, startTime, stopTime, memberName, beginMoney, endMoney);
	}

	@Override
	public List<DetailCondition> findDetailsByConditions(
			DetailCondition detailCondition) throws SQLException {
		return detailDao.findDetailsByConditions(detailCondition);
	}

	@Override
	public List<DayConsumeCondition> findDayConsumeConditions(
			DayConsumeCondition dcc) throws SQLException {
		return detailDao.findDayConsumeConditions(dcc);
	}

	@Override
	public List<YearConsumeCondition> findYearConsumeConditions(
			YearConsumeCondition ycc) throws SQLException {
		return detailDao.findYearConsumeConditions(ycc);
	}

	@Override
	public boolean deleteDetailBymemberId(int memberId) throws SQLException {
		return detailDao.deleteDetailBymemberId(memberId);
	}
	

}
